﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<iBuproModel.StudentPlan>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Details</h2>

    <fieldset>
        <legend>Fields</legend>
        
        <div class="display-label">Name</div>
        <div class="display-field"><%: Model.Name %></div>

        <div class="display-label">Shortcut</div>
        <div class="display-field"><%: Model.Shortcut %></div>
        
    </fieldset>
    <div class="display-label">Student fields</div>
        <div>
            <table>
            <thead>
                <tr>
                    <th>
                 <%:Html.Translate("name")%>

                    </th>
                    <th>
                 <%:Html.Translate("shortcut")%>


                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
            <% foreach (var item in Model.StudentFields) { %>
    
                <tr>
                    <td>
                        <%: item.Name %>
                    </td>
                    <td>
                        <%: item.Shortcut %>
                    </td>
                    <td>
                        <%: Html.ActionLink("All Subjects","Filter","Subject",new{id = item.Id,what = "studentfield",filtername = "Filtering for Student field " + item.Name},null)%>
                    </td>
                </tr>
    
            <% } %>
            </tbody>
            </table>
    </div>

    <div>
    <div class="display-label">Subjects</div>
    <table>
    <thead>
        <tr>
            <th></th>
            <th>
                                 <%:Html.Translate("name")%>

            </th>
            <th>
                                 <%:Html.Translate("shortcut")%>

            </th>
            <th>
                                 <%:Html.Translate("department")%>

            </th>
            <th>
                                 <%:Html.Translate("visibility")%>

            </th>
            <th>
                                 <%:Html.Translate("projects")%>

            </th>
        </tr>
    </thead>
    <tbody>
    <% foreach (var item in Model.Subjects) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink(Html.Translate("edit"), "Edit", new { id=item.Id }) %> |
            </td>
            <td>
                <%: item.Name %>
            </td>
            <td>
                <%: item.Shortcut %>
            </td>
            <td>
                <%: item.Department.Name %>
            </td>
            <td>
                <%: item.Visible %>
            </td>
            <td>
                <%:Html.ActionLink(Html.Translate("projekty"), "Filter", "Project", new { id = item.Id }, null)%>
            </td>
        </tr>
    
    <% } %>
    </tbody>
    </table>
    </div>
    <p>

        <%: Html.ActionLink(Html.Translate("edit"), "Edit", new { id = Model.Id })%> |
    </p>

</asp:Content>

